
define(function(require, exports, module){
    var util = {};

    util.getStorage = function(key){
		var key = 'music_' + key;
		return sessionStorage.getItem(key);
    };

    util.setStorage = function(key,data){
		var key = 'music_' + key;
		sessionStorage.setItem(key,JSON.stringify(data));
    };

    util.getLocalStorage = function(key){
		var key = 'music_' + key;
		return JSON.parse(localStorage.getItem(key));
    };

    util.setLocalStorage = function(key,data){
		var key = 'music_' + key;
		try {
			localStorage.setItem(key,JSON.stringify(data));
		}
		catch (error) {
			// alert("您处于无痕浏览，无法为您保存！")
		}
	};

    util.setCookie = function(key,data,expire){
		var date = new Date();
		var expireDays = expire;
		date.setTime(date.getTime() + expireDays * 24 * 3600 * 1000); 
		document.cookie=key+"="+data+";expires="+date.toGMTString(); 
    };

    module.exports = util;
});
